<!DOCTYPE html>
<html lang="en">
	<head>
	    <meta charset="UTF-8">
	    <meta name="renderer" content="webkit">
	    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	    <title>建新街道移动办公 - E事通</title>
	    <link rel="stylesheet" href="/app/static/layui/css/layui.css">
	    <link rel="stylesheet" href="/app/static/styles/style.css">
	    <link rel="icon" href="image/code.png">
	    <script src="/app/static/scripts/jquery-1.9.1.js"></script>
	    <script type="text/javascript" src="/app/static//layui/layui.all.js"></script>
		<script type="text/javascript" src="/app/static/scripts/index.js"></script>
	</head>

	<body class="body">
		
		<a href="javascript:history.go(-1);" class="layui-btn">返回</a>	
		<form class="layui-form layui-form-labelw100" style="width: 500px;margin-top: 30px;">
			<div class="layui-form-item">
				<label class="layui-form-label">用户头像</label>
				<div class="layui-input-block">
					<div class="img-box">
						<img src="" id="showAvatar"/>
					</div>
					<div class="def_uploadFile">
					    <div class="def_uploadBtn">选择</div>
					    <input type="file" id="avatarFile">
					</div>
					<div class="def_uploadFile">
					    <div class="def_uploadBtn">清除</div>
					</div>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label"><i class="must_star">*</i>用户名</label>
				<div class="layui-input-block">
					<input type="text" required lay-verify="required" placeholder="请输入用户名" class="layui-input">
					<p class="input_tips">用户名由4-20个英文字母或数字组成（不支持中文，不区分大小写字母）。一旦创建成功，不可修改</p>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label"><i class="must_star">*</i>密码</label>
				<div class="layui-input-block">
					<input type="text" required lay-verify="required" placeholder="请输入密码" class="layui-input">
					<p class="input_tips">密码由6-20个英文字母（区分大小写）或数字。</p>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label"><i class="must_star">*</i>分配角色</label>
				<div class="layui-input-block">
					<select>
				        <option value="">超级管理员</option>
				        <option value="0">一级账户</option>
				        <option value="1">二级账户</option>
				        <option value="2">三级账户</option>
				        <option value="3">其他账户</option>
			      	</select>
				</div>
			</div>	
			
			<div class="layui-form-item">
				<label class="layui-form-label"><i class="must_star">*</i>确认密码</label>
				<div class="layui-input-block">
					<input type="text" required lay-verify="required" placeholder="请确认密码" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label"><i class="must_star">*</i>真实姓名</label>
				<div class="layui-input-block">
					<input type="text" required lay-verify="required" placeholder="请输入真实姓名" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label"><i class="must_star">*</i>手机号码</label>
				<div class="layui-input-block">
					<input type="text" required lay-verify="required" placeholder="请输入手机号码" class="layui-input">
					<p class="input_tips">手机将作为找回密码的重要依据。</p>
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-input-block">
					<button type="reset" class="layui-btn layui-btn-primary">取消</button>
					<button class="layui-btn" lay-submit>保存</button>
				</div>
			</div>
		</form>
		
		
		

		<script type="text/javascript">
			var form = layui.form,
				layer = layui.layer,
				laypage = layui.laypage,
				layedit = layui.layedit,
				laydate = layui.laydate;
			
				
				form.render()
			
			
			
			
			
			
				$('body').delegate('#avatarFile','change',function(){
				  	var objUrl = getObjectURL(this.files[0]) ;  
				  	$('#showAvatar').attr('src',objUrl)
			  	})
		  
				//建立一個可存取到該file的url  
				function getObjectURL(file) {
					var url = null;
					// 下面函数执行的效果是一样的，只是需要针对不同的浏览器执行不同的 js 函数而已  
					if(window.createObjectURL != undefined) { // basic  
						url = window.createObjectURL(file);
					} else if(window.URL != undefined) { // mozilla(firefox)  
						url = window.URL.createObjectURL(file);
					} else if(window.webkitURL != undefined) { // webkit or chrome  
						url = window.webkitURL.createObjectURL(file);
					}
					return url;
				}
				
		</script>
	</body>

</html>